package knowledgeSources;


import java.util.ArrayList;

import expertSystem.IKnowledgeBase;
import expertSystem.IKnowledgeSource;
import expertSystem.IMainKnowledgeSource;
import expertSystem.Knowledge;
import expertSystem.KnowledgeType;

public class TestMainKnowledgeSource implements IMainKnowledgeSource
{
	int Index=-1;
	ArrayList<IKnowledgeSource> List; 
	String LoadPath,SavePath; 
	//===========================================================================
	public TestMainKnowledgeSource(String loadPath,String savePath)
	{
		LoadPath = loadPath;
		SavePath = savePath;
		List = new ArrayList<IKnowledgeSource>();
		List.add(new LoadImageKSource("SourceImg"));
		List.add(new ImageSketchKSource(1, "SourceImg", "Sketch"));///
		List.add(new BinKnowledgeSource("Sketch"));
		//List.add(new BinKnowledgeSource("Sketch", "BinImg"));
		List.add(new SaveImageKSource("Sketch",SavePath));
		//List.add(new SaveImageKSource("Sketch",SavePath));
	}
	//===========================================================================
	@Override
	public IKnowledgeSource NextKnowledgeSource(IKnowledgeBase KBase) 
	{
		if(Index==-1)
		{
			KBase.Add(KnowledgeType.Text, new Knowledge(LoadPath, "LoadPath"));			
		}
		Index++;
		if(Index<List.size())
			return List.get(Index);
		return null;
	}
	//===========================================================================
}
